package sfmc.biz.serviceImpl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;

import sfmc.biz.dao.SfmcCustomerDao;
import sfmc.biz.dao.SfmcHolidayDao;
import sfmc.biz.service.SfmcHolidayService;
import sfmc.biz.vo.Sfmc_TB_HOLIDAY;

@Service("SfmcHolidayService")
public class SfmcHolidayServiceImpl implements SfmcHolidayService{
	
	protected Log log = LogFactory.getLog(this.getClass());
	
	@Resource(name="SfmcHolidayDao")
	private SfmcHolidayDao sfmcHolidayDao;
	
	public void setSfmcHoliday(SfmcCustomerDao sfmcCustomerDao){
		this.sfmcHolidayDao = sfmcHolidayDao;
	}

	public List<Sfmc_TB_HOLIDAY> getHolidayList(Sfmc_TB_HOLIDAY sfmc_TB_HOLIDAY){
		return sfmcHolidayDao.getHolidayList(sfmc_TB_HOLIDAY);
	}

	public int insertHoliday(Sfmc_TB_HOLIDAY dto) {
		try{
			sfmcHolidayDao.insertHoliday(dto);
			return 1;
		}catch(Exception e){
			log.error(e);
			return -1;
		}
	}
	
	public int updateHoliday(Sfmc_TB_HOLIDAY dto) {
		try{
			return sfmcHolidayDao.updateHoliday(dto);
		}catch(Exception e){
			log.error(e);
			return -1;
		}
	}

	public int deleteHoliday(Sfmc_TB_HOLIDAY dto) {
		try{
			return sfmcHolidayDao.deleteHoliday(dto);
		}catch(Exception e){
			log.error(e);
			return -1;
		}
	}
}
